from django.urls import path

from .views import RegisterAPIView, LoginAPIView,ResourceAPIView,RefreshTokenAPIView,PrivacyView,PersonView,DepositView,OrderView,UserRoleView,UserResourceView
from .views import RegisterAPIView, LoginAPIView,ResourceAPIView,PrivacyView,PersonView,DepositView,OrderView,WithView,ServiceView,QuitViewApi,RoleView
from .views import RegisterAPIView, LoginAPIView,ResourceAPIView,RefreshTokenAPIView,PrivacyView,PersonView,DepositView,OrderView
from .views import RegisterAPIView, LoginAPIView,ResourceAPIView,PrivacyView,PersonView,DepositView,OrderView,WithView,ServiceView,QuitViewApi,RoleView,RoleResourceView,AddARole,WorkflowView,WorkflowPermissionView
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'person', PersonView, basename='person')
router.register(r'deposit', DepositView, basename='deposit')
router.register(r'privacy', PrivacyView, basename='privacy')
router.register(r'order', OrderView, basename='order')
router.register(r'with', WithView)
router.register(r'service', ServiceView)
router.register(r'workflow', WorkflowView)
router.register(r'wfpm', WorkflowPermissionView)
# router.register(r'roles', RolesView)
# 角色资源表
router.register(r'roleresource', UserResourceView)




urlpatterns = [
    path('register/', RegisterAPIView.as_view(), name='register'),
    path('login/', LoginAPIView.as_view(), name='login'),
    path("ziyuan/",ResourceAPIView.as_view(),name="ziyuan" ) ,
    path("refresh_token/",RefreshTokenAPIView.as_view(),name="refresh_token" ) ,
    path("quit/",QuitViewApi.as_view(),name="quit" ),
    path("role/",RoleView.as_view(),name="role" ),
    # path('role/<int:role_id>/ziyuan/', RoleResourceAPIView.as_view(), name='role-resources'),
    # path('roless/', RoleCreateAPIView.as_view(), name='role-create'),


    # 用户角色表
    path("user_role/",UserRoleView.as_view(),name="user_role" ),
    path("roleres/",RoleResourceView.as_view(),name="RoleRes"),
    path("addroles/",AddARole.as_view(),name="addroles"),

] + router.urls




